<?php

//获取字段筛选参数
$fields = "*";
if(isset($route->bodyParams['fields'])){
    $fields = $route->bodyParams['fields'];
}

//默认条件
$route->restfulParams['is_delete'] = 0;

$oscr_status = $route->restfulParams['oscr_status'];
$os_oesid = $route->restfulParams['os_oesid'];

if(isset($route->restfulParams['oscr_ocid'])){
    $oscr_ocid_str = "and oscr_ocid=".$route->restfulParams['oscr_ocid'];
}else{
    $oscr_ocid_str = "";   
}


$sql = "select oscr.*,os.os_name,os.os_birthday,os.os_phone,os.os_parents_identity,os.os_id,os.os_oesid from art_oa_student_course_record as oscr,art_oa_student as os where os.os_oesid = ".$os_oesid." and oscr_status = ".$oscr_status." and oscr.oscr_osid = os.os_id and oscr.is_delete = 0 ".$oscr_ocid_str." group by oscr_osid;";

$re= $db->mysqlDB->query($sql);

$res = array( "data" => $re);

//返回成功结果
$response->responseData( true,$res);